package com.example.tests;

public class ContactData  implements Comparable<ContactData>{

	private String id;
	private String firstname;
	private String lastname;
	private String address;
	private String phoneHome;
	private String phoneMobile;
	private String phoneWork;
	private String email;
	private String secondEmail;
	private String birthdayDay;
	private String birthdayMonth;
	private String birthdayYear;
	private String groupName;
	private String addressGroup;
	private String phoneGroup;


	public ContactData() {
	}

	public ContactData(String firstname, String lastname, String address,
			String phoneHome, String phoneMobile, String phoneWork,
			String email, String secondEmail, String birthdayDay,
			String birthdayMonth, String birthdayYear, String groupName,
			String addressGroup, String phoneGroup) {
		this.firstname = firstname;
		this.lastname = lastname;
		this.address = address;
		this.phoneHome = phoneHome;
		this.phoneMobile = phoneMobile;
		this.phoneWork = phoneWork;
		this.email = email;
		this.secondEmail = secondEmail;
		this.birthdayDay = birthdayDay;
		this.birthdayMonth = birthdayMonth;
		this.birthdayYear = birthdayYear;
		this.groupName = groupName;
		this.addressGroup = addressGroup;
		this.phoneGroup = phoneGroup;
	}

	@Override
	public String toString() {
		return "ContactData [id=" + id + ", firstname=" + firstname
				+ ", lastname=" + lastname + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((lastname == null) ? 0 : lastname.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (lastname == null) {
			if (other.lastname != null)
				return false;
		} else if (!lastname.equals(other.lastname))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other) {
		return this.lastname.toLowerCase().compareTo(other.lastname.toLowerCase());
	}

	public ContactData withFirstName(String fistName) {
		this.firstname = fistName;
		return this;
	}

	public ContactData withLastName(String lastName) {
		this.lastname = lastName;
		return this;
	}

	public ContactData withAddress(String address) {
		this.address = address;
		return this;
	}

	public ContactData withPhoneHome(String phoneHome) {
		this.phoneHome = phoneHome;
		return this;
	}

	public ContactData withPhoneMobile(String phoneMobile) {
		this.phoneMobile = phoneMobile;
		return this;
	}

	public ContactData withPhoneWork(String phoneWork) {
		this.phoneWork = phoneWork;
		return this;
	}

	public ContactData withEmail(String email) {
		this.email = email;
		return this;
	}

	public ContactData withSecondEmail(String secondEmail) {
		this.secondEmail = secondEmail;
		return this;
	}

	public ContactData withBirthdayDay(String birthdayDay) {
		this.birthdayDay = birthdayDay;
		return this;
	}

	public ContactData withBirthdayMonth(String birthdayMonth) {
		this.birthdayMonth = birthdayMonth;
		return this;
	}

	public ContactData withBirthdayYear(String birthdayYear) {
		this.birthdayYear = birthdayYear;
		return this;
	}

	public ContactData withGroupName(String groupName) {
		this.groupName = groupName;
		return this;
	}

	public ContactData withAddressGroup(String addressGroup) {
		this.addressGroup = addressGroup;
		return this;
	}

	public ContactData withPhoneGroup(String phoneGroup) {
		this.phoneGroup = phoneGroup;
		return this;
	}

	public String getId() {
		return id;
	}
	
	public String getFirstname() {
		return firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public String getAddress() {
		return address;
	}

	public String getPhoneHome() {
		return phoneHome;
	}

	public String getPhoneMobile() {
		return phoneMobile;
	}

	public String getPhoneWork() {
		return phoneWork;
	}

	public String getEmail() {
		return email;
	}

	public String getSecondEmail() {
		return secondEmail;
	}

	public String getBirthdayDay() {
		return birthdayDay;
	}

	public String getBirthdayMonth() {
		return birthdayMonth;
	}

	public String getBirthdayYear() {
		return birthdayYear;
	}

	public String getGroupName() {
		return groupName;
	}

	public String getAddressGroup() {
		return addressGroup;
	}

	public String getPhoneGroup() {
		return phoneGroup;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setPhoneHome(String phoneHome) {
		this.phoneHome = phoneHome;
	}

	public void setPhoneMobile(String phoneMobile) {
		this.phoneMobile = phoneMobile;
	}

	public void setPhoneWork(String phoneWork) {
		this.phoneWork = phoneWork;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setSecondEmail(String secondEmail) {
		this.secondEmail = secondEmail;
	}

	public void setBirthdayDay(String birthdayDay) {
		this.birthdayDay = birthdayDay;
	}

	public void setBirthdayMonth(String birthdayMonth) {
		this.birthdayMonth = birthdayMonth;
	}

	public void setBirthdayYear(String birthdayYear) {
		this.birthdayYear = birthdayYear;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public void setAddressGroup(String addressGroup) {
		this.addressGroup = addressGroup;
	}

	public void setPhoneGroup(String phoneGroup) {
		this.phoneGroup = phoneGroup;
	}

}